from pathlib import Path

import pytest
from graph.mapper.triples_parser import TriplesParser
from graph.model.extraction import Extraction

TEST_DATA = "tests/data"
TRIPLES_JSON = f"{TEST_DATA}/triples.json"


@pytest.fixture(scope="class")
def sample_triples_json() -> str:
    text = Path(TRIPLES_JSON).read_text()
    return text


@pytest.fixture(scope="class")
def sample_extraction(sample_triples_json: str) -> Extraction:
    triples_parser = TriplesParser()
    return triples_parser.parse(sample_triples_json)
